module fn.text.Patterns

let (|Prefix|_|) (p:string) (s:string) =
    if s.StartsWith(p) then
        Some(s.Substring(p.Length))
    else
        None
        
let (|Suffix|_|) (p:string) (s:string) =
    if s.EndsWith(p) then
        Some(s.Substring(0, s.Length - p.Length))
    else
        None